package com.ivan.toolkit.common;

public class NotifyWaiter {
	
	boolean notified = false;

	public NotifyWaiter() {
		super();
	}

	public void doWait(long timeout) {
		
		synchronized(this) {
			
			try{
				
				notified = false;
				
				this.wait(timeout);
				
			} catch (Exception e) {
				
			}

		}
		
	}
	
	public void doNotify() {
		
		synchronized(this) {
			
			try {
				
				notified = true;
				
				this.notify();
				
			} catch (IllegalMonitorStateException e) {
				
				e.printStackTrace();
				
			}
		}
	}
	
	public boolean isNotified() {
		return notified;
	}

}
